﻿using System.Windows;

namespace 构造器
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += MainWindow_Loaded;
        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            // 实现依赖注入
            IEngine engine = new Constructor();
            Car _car = new Car(engine);
            _car.Drive();
        }
    }
}
